package com.gxa.autoparts.core.common;

import java.util.HashMap;
import java.util.Map;

/**
 * @author R
 * @data 2021-09-13 16:17
 */
public class JsonResult {

    private String code;
    private String msg;
    private Object data;
    private Map<String,Object> dataMap = new HashMap<>();
    public JsonResult() {
    }

    public JsonResult(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public String getCode() {
        return dataMap.get("code").toString();
    }

    public void setCode(String code) {
        dataMap.put("code",code);
    }

    public String getMsg() {
        return dataMap.get("msg").toString();
    }

    public void setMsg(String msg) {
        dataMap.put("msg",msg);
    }

    public Object getData() {
        return dataMap.get("data");
    }

    public Map<String, Object> getDataMap() {
        return dataMap;
    }

    public void setData(Object data) {
        dataMap.put("data",data);
    }
    public void put(String name,Object value){
        dataMap.put(name,value);
    }
}
